package com.suray.wcs.service.hk.agv.bean;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@Data
public class HkTaskContinue {

    @JsonProperty("reqCode")
    private String reqCode;
    @JsonProperty("reqTime")
    private String reqTime;
    @JsonProperty("clientCode")
    private String clientCode;
    @JsonProperty("tokenCode")
    private String tokenCode;
    @JsonProperty("wbCode")
    private String wbCode;
    @JsonProperty("podCode")
    private String podCode;
    @JsonProperty("agvCode")
    private String agvCode;
    @JsonProperty("taskCode")
    private String taskCode;
    @JsonProperty("taskSeq")
    private String taskSeq;
    @JsonProperty("nextPositionCode")
    private NextPositionCodeDTO nextPositionCode;

    @NoArgsConstructor
    @Data
    public static class NextPositionCodeDTO {
        @JsonProperty("positionCode")
        private String positionCode;
        @JsonProperty("type")
        private String type;

        NextPositionCodeDTO(String positionCode, String type) {
            this.positionCode = positionCode;
            this.type = type;
        }
    }

    public HkTaskContinue(String reqCode, String taskCode) {
        this.reqCode = reqCode;
        reqTime = "";
        clientCode = "";
        tokenCode = "";
        wbCode = "";
        podCode = "";
        agvCode = "";
        this.taskCode = taskCode;
        taskSeq = "";
        nextPositionCode = null;
    }

    public HkTaskContinue(String reqCode, String taskCode, String point) {
        this.reqCode = reqCode;
        reqTime = "";
        clientCode = "";
        tokenCode = "";
        wbCode = "";
        podCode = "";
        agvCode = "";
        this.taskCode = taskCode;
        taskSeq = "";
        nextPositionCode = new NextPositionCodeDTO(point, "00");
    }
}
